/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kinect_biomec;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author vanderson
 */
public class infoUpdater implements Runnable {

    Kinect_BioMecView painel;

    public infoUpdater(Kinect_BioMecView painel) {
        this.painel = painel;
    }

    public void run() {
        while (true) {
            try {
                synchronized (this) {
                    wait(500);
                }
            } catch (InterruptedException ex) {
                Logger.getLogger(Kinect_BioMecView.class.getName()).log(Level.SEVERE, null, ex);
            }
            painel.getInfoPainel().setText("Número de usuarios: " + painel.control.getContext().getNumberOfUsers() + "\n"
                    + "Altura usuario: " + painel.control.getContext().userHeight());
           if(painel.is3D){
               painel.info.setText(painel.control.kinectView3D.msg);
           }else{
            painel.info.setText(painel.control.kinectView.msg); 
           }
        }

    }
}
